package com.coocaa.ops.admin.base.schedule;

import java.util.Objects;

/**
 * @author bjh
 * @description
 * @date 2021/6/2 14:39
 */
public abstract class AbstractCronScheduleTask extends BaseCronScheduleTask {
    abstract protected BaseScheduleConfig getBaseScheduleConfig();

    @Override
    protected boolean isCanDoRun() {
        return null != getBaseScheduleConfig() && Objects.equals(Boolean.TRUE, getBaseScheduleConfig().getRefreshEnable());
    }

    @Override
    protected String getCron() {
        return getBaseScheduleConfig().getCron();
    }
}
